3.231 \(\int \cos (c+d x) (a \sin (c+d x)+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=22 \[ -\frac{(a \cos (c+d x)+b)^2}{2 a d} \]

[Out]

-(b + a*Cos[c + d*x])^2/(2*a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0302323, antiderivative size = 29, normalized size of antiderivative = 1.32, number of steps used = 5, number of rules used = 5, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.208, Rules used = {4377, 12, 2638, 2564, 30} \[ \frac{a \sin ^2(c+d x)}{2 d}-\frac{b \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a*Sin[c + d*x] + b*Tan[c + d*x]),x]

[Out]

-((b*Cos[c + d*x])/d) + (a*Sin[c + d*x]^2)/(2*d)

Rule 4377

Int[(u_)*((v_) + (d_.)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^(n_.)), x_Symbol] :> With[{e = FreeFactors[Cos[c*(a +
b*x)], x]}, Int[ActivateTrig[u*v], x] + Dist[d, Int[ActivateTrig[u]*Sin[c*(a + b*x)]^n, x], x] /; FunctionOfQ[
Cos[c*(a + b*x)]/e, u, x]] /; FreeQ[{a, b, c, d}, x] &&  !FreeQ[v, x] && IntegerQ[(n - 1)/2] && NonsumQ[u] &&
(EqQ[F, Sin] || EqQ[F, sin])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \cos (c+d x) (a \sin (c+d x)+b \tan (c+d x)) \, dx &=a \int \cos (c+d x) \sin (c+d x) \, dx+\int b \sin (c+d x) \, dx\\ &=b \int \sin (c+d x) \, dx+\frac{a \operatorname{Subst}(\int x \, dx,x,\sin (c+d x))}{d}\\ &=-\frac{b \cos (c+d x)}{d}+\frac{a \sin ^2(c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0107171, size = 40, normalized size = 1.82 \[ -\frac{a \cos ^2(c+d x)}{2 d}+\frac{b \sin (c) \sin (d x)}{d}-\frac{b \cos (c) \cos (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a*Sin[c + d*x] + b*Tan[c + d*x]),x]

[Out]

-((b*Cos[c]*Cos[d*x])/d) - (a*Cos[c + d*x]^2)/(2*d) + (b*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 26, normalized size = 1.2 \begin{align*} -{\frac{1}{d} \left ({\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{2}a}{2}}+b\cos \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x)

[Out]

-1/d*(1/2*cos(d*x+c)^2*a+b*cos(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.10742, size = 34, normalized size = 1.55 \begin{align*} -\frac{a \cos \left (d x + c\right )^{2} + 2 \, b \cos \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(a*cos(d*x + c)^2 + 2*b*cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.477275, size = 62, normalized size = 2.82 \begin{align*} -\frac{a \cos \left (d x + c\right )^{2} + 2 \, b \cos \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)^2 + 2*b*cos(d*x + c))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a \sin{\left (c + d x \right )} + b \tan{\left (c + d x \right )}\right ) \cos{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x)

[Out]

Integral((a*sin(c + d*x) + b*tan(c + d*x))*cos(c + d*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.19092, size = 138, normalized size = 6.27 \begin{align*} -\frac{a \cos \left (2 \, d x + 2 \, c\right )}{4 \, d} - \frac{b \tan \left (\frac{1}{2} \, d x\right )^{2} \tan \left (\frac{1}{2} \, c\right )^{2} - b \tan \left (\frac{1}{2} \, d x\right )^{2} - 4 \, b \tan \left (\frac{1}{2} \, d x\right ) \tan \left (\frac{1}{2} \, c\right ) - b \tan \left (\frac{1}{2} \, c\right )^{2} + b}{d \tan \left (\frac{1}{2} \, d x\right )^{2} \tan \left (\frac{1}{2} \, c\right )^{2} + d \tan \left (\frac{1}{2} \, d x\right )^{2} + d \tan \left (\frac{1}{2} \, c\right )^{2} + d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*a*cos(2*d*x + 2*c)/d - (b*tan(1/2*d*x)^2*tan(1/2*c)^2 - b*tan(1/2*d*x)^2 - 4*b*tan(1/2*d*x)*tan(1/2*c) -
b*tan(1/2*c)^2 + b)/(d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(1/2*d*x)^2 + d*tan(1/2*c)^2 + d)